// Package day_14_two_point 2-26
// @Title day_14_two_point
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/7 16:31
// @Create  2021/9/7 16:31
package day_14_two_point

func RemoveDuplicates(nums []int) int {
	n := len(nums)
	if n == 0 {
		return 0
	}
	slow := 1
	for fast := 1; fast < n; fast++ {
		if nums[fast] != nums[fast-1] {
			nums[slow] = nums[fast]
			slow++
		}
	}
	return slow
}

// 写暴力版本
//func RemoveDuplicatesOld(nums []int) int {
//
//}
